package com.wangsh.usersCenter.system.pojo;

import java.util.Date;
import java.util.Map;
import java.util.TreeMap;

import com.wangsh.usersCenter.common.pojo.BasePojo;

/**
 * 日志的pojo
 * 
 * @author wangshh
 */
public class ASysLog extends BasePojo<ASysLog>
{
	private int id;
	private int relaId;
	private int sysIpId ;
	private String name;
	private String ip;
	private String content;
	private byte logType ;
	private byte status ; 
	private Date createTime;
	private Date updateTime;
	private Date pubTime ; 
	/* 字符串描述 */
	private String statusStr ;
	private String logTypeStr ;
	/* 关联关系 */
	private ASysIp sysIp ;
	
	private Map<String,String> enumsMap = new TreeMap<String, String>();

	public Map<String, String> getEnumsMap()
	{
		// 根据状态值获取字符串描述
		ASysLogEnum[] aLogEnums = ASysLogEnum.values();
		for (int i = 0; i < aLogEnums.length; i++)
		{
			ASysLogEnum alogEnum = aLogEnums[i];
			String key = alogEnum.toString() ; 
			enumsMap.put(key + "-" + alogEnum.getStatus() + "", alogEnum.getName());
		}
		return enumsMap;
	}
	public String getStatusStr()
	{
		// 根据状态值获取字符串描述
		ASysLogEnum[] logEnums = ASysLogEnum.values();
		for (int i = 0; i < logEnums.length; i++)
		{
			ASysLogEnum logEnum = logEnums[i];
			if (logEnum.toString().startsWith("STATUS_"))
			{
				// 表示是状态的标识
				if (logEnum.getStatus() == this.getStatus())
				{
					this.statusStr = logEnum.getName();
					break;
				}
			}
		}
		return statusStr;
	}
	
	public String getLogTypeStr()
	{
		// 根据状态值获取字符串描述
		ASysLogEnum[] logEnums = ASysLogEnum.values();
		for (int i = 0; i < logEnums.length; i++)
		{
			ASysLogEnum logEnum = logEnums[i];
			if (logEnum.toString().startsWith("LOGTYPE_"))
			{
				// 表示是状态的标识
				if (logEnum.getStatus() == this.getLogType())
				{
					this.logTypeStr = logEnum.getName();
					break;
				}
			}
		}
		return logTypeStr;
	}

	public int getId()
	{
		return id;
	}

	public void setId(int id)
	{
		this.id = id;
	}

	public String getName()
	{
		return name;
	}

	public void setName(String name)
	{
		this.name = name;
	}

	public String getIp()
	{
		return ip;
	}

	public void setIp(String ip)
	{
		this.ip = ip;
	}

	public String getContent()
	{
		return content;
	}

	public void setContent(String content)
	{
		this.content = content;
	}

	public byte getStatus()
	{
		return status;
	}

	public void setStatus(byte status)
	{
		this.status = status;
	}

	public Date getCreateTime()
	{
		return createTime;
	}

	public void setCreateTime(Date createTime)
	{
		this.createTime = createTime;
	}

	public Date getUpdateTime()
	{
		return updateTime;
	}

	public void setUpdateTime(Date updateTime)
	{
		this.updateTime = updateTime;
	}

	public Date getPubTime()
	{
		return pubTime;
	}

	public void setPubTime(Date pubTime)
	{
		this.pubTime = pubTime;
	}

	public int getSysIpId()
	{
		return sysIpId;
	}

	public void setSysIpId(int sysIpId)
	{
		this.sysIpId = sysIpId;
	}

	public ASysIp getSysIp()
	{
		return sysIp;
	}

	public void setSysIp(ASysIp sysIp)
	{
		this.sysIp = sysIp;
	}

	public int getRelaId()
	{
		return relaId;
	}

	public void setRelaId(int relaId)
	{
		this.relaId = relaId;
	}

	public byte getLogType()
	{
		return logType;
	}

	public void setLogType(byte logType)
	{
		this.logType = logType;
	}

}
